package com.fang.active;

import com.fang.bean.UserInfoBean;
import com.sun.deploy.net.HttpRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.HttpRequestHandler;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class UserInfoAction {

    @RequestMapping("/doLogin4")
    public ModelAndView doLogin4(UserInfoBean userInfoBean) {
        //打印形参列表
        System.out.println("用户名："+userInfoBean.getUserName()+",密码："+userInfoBean.getUserPsw());
        ModelAndView mav = new ModelAndView();
        mav.setViewName("logined");
        //形如request的setAttribute方法，进行数据的缓存
        mav.addObject("userLoginedName",userInfoBean.getUserName());
        // 返回显示视图的路径
        return mav;
    }
    @RequestMapping("/doLogin3")
    public String helloworld3(UserInfoBean userInfoBean) {
        //打印形参列表
        System.out.println("用户名："+userInfoBean.getUserName()+",密码："+userInfoBean.getUserPsw());
        // 返回显示视图的路径
        return "logined";
    }
    @RequestMapping("/doLogin2")
    public String helloworld2(String userName,String userPsw) {
        //打印形参列表
        System.out.println("用户名："+userName+",密码："+userPsw);
        // 返回显示视图的路径
        return "logined";
    }
    @RequestMapping("/doLogin")
    public String helloworld() {
        // 返回显示视图的路径
        return "logined";
    }
}
